
package fileby.ctrl.actions.impl;

import fileby.model.ISelectionManager;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.KeyStroke;

/**
 *
 * @author Jacob
 */
class SelectAllAction extends AbstractAction {

    private ISelectionManager selectionManager;

     public SelectAllAction(ISelectionManager selectionManager) {
        super("Select All", null);
        this.selectionManager = selectionManager;
        putValue(SHORT_DESCRIPTION, "Select all files");
        putValue(MNEMONIC_KEY, KeyEvent.VK_S);
        putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_DOWN_MASK));
    }

    public void actionPerformed(ActionEvent e) {
        selectionManager.setAllSelected(true);
    }

}
